﻿using System;

namespace Candy.Infrastructure
{
    public class ErrorMessage
    {
        public Exception Error { get; private set; }

        private string _errorMessage;
        public string Message
        {
            get
            {
                if (Error == null)
                    return Message;
                else
                    return _errorMessage;

            }

        }

        public ErrorMessage(Exception error)
        {
            Error = error;
        }

        public ErrorMessage(string message)
        {
            _errorMessage = message;
        }
    }
}
